<?php 
$cs=Yii::app()->clientScript;
$cs->registerScript('type_tail_board_dialog_view',<<<END
$(document).bind('keydown',function(e){if(e.keyCode==27){parent.$.modal.close();}});
$("a[href=#]").click(function(){
	\$parent=$(window.parent.document);
	type_name=\$parent.find("#Tail_board_type").length==0?\$parent.find("#Trucks_type"):\$parent.find("#Tail_board_type");
	type_name.val($(this).text()).removeClass('error').next('span').remove();
	type=\$parent.find("#Tail_board_fk_type_id").length==0?\$parent.find("#Trucks_fk_type_id"):\$parent.find("#Tail_board_fk_type_id");
	type.val($(this).attr('class'));
	parent.$.modal.close();
	return false;
});
END
)
?>
<?php echo CHtml::beginForm(array($this->action->id));?>
<div style="padding-left:30px">
	车型：<input type="text" name="keys[type_name]" size="7" value="<?php echo isset($_GET['keys']['type_name'])?$_GET['keys']['type_name']:'';?>"/>
	模糊查询：<input type="radio" name="keys[blur]" value="1" checked/>是  
	<input type="radio" name="keys[blur]" value="0" <?php echo isset($_GET['keys']['blur'])&&$_GET['keys']['blur']==0?'checked':'';?>/>否 
	<input type="submit" value="搜索"/>
</div>
<?php echo CHtml::endForm();?>
<table class="dataGrid"  width=90%>
  <tbody>
  	<tr>
<?php foreach($models as $n=>$model): ?>
	<?php if($n>1&&$n%4==0) echo '</tr><tr>';?>
    <td><?php echo CHtml::link($model->type_name,'#',array('class'=>$model->id)); ?></td>
<?php endforeach; ?>
	</tr>
  </tbody>
</table>
<br/>
<?php $this->widget('CLinkPager',array('pages'=>$pages,'maxButtonCount'=>Yii::app()->params['dialog'][$this->action->id]['maxButtonCount'])); ?>